/*
 * NetReceiver.h
 *
 *  Created on: 2011-04-18
 *      Author: jacek
 */

#ifndef NETRECEIVER_H_
#define NETRECEIVER_H_

#include <Component.h>
#include <Socket.h>

using namespace Net;

class NetUDPReceiver: public Component {
	Socket receiverSock;
	NetAddress peer;
	Package package;
	Event* eventBuf;
    void ConvertEventNetToHost();
public:
	NetUDPReceiver();
	NetUDPReceiver(Socket &src );
	NetAddress GetLastPeer(){return peer;}
	virtual ~NetUDPReceiver();
	virtual void Updata(Event event);
	virtual void Intialization();
	virtual void Dispose();
	virtual void SendEvent(Event event);

};

#endif /* NETRECEIVER_H_ */
